﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowSprints.aspx.cs" Inherits="Actuals.ShowSprints" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function showAddSprint() {
            var result = window.showModalDialog('AddSprint.aspx', this,
                'dialogHeight:400px;dialogWidth:400px;Status:yes;Toolbars:no;Scroll:yes;Help:no;Center:yes;');
            __doPostBack('refresh', 'refresh');
        }

        function ShowUpdateSprints(sprintId) {
            var url = 'AddSprint.aspx?Mode=Edit&SprintId=' + sprintId;
            var result = window.showModalDialog(url, this,
                'dialogHeight:700px;dialogWidth:400px;Status:yes;Toolbars:no;Scroll:yes;Help:no;Center:yes;');
            __doPostBack('refresh', 'refresh');
        }

        function TestCheckBox() {
            var Target = null;
            Target = document.getElementById('<%= this.gvResults.ClientID %>');
            if (Target == null) {
                alert("no record is selected.Please select!");
                return false;
            }
            var Inputs = Target.getElementsByTagName("input");

            for (var n = 0; n < Inputs.length; ++n) {
                if (Inputs[n].type == 'checkbox' && Inputs[n].checked) {
                    return confirm("Do you want to Delete");
                }


            }
            alert("no record is selected.Please select!");
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <center>
    <div>
        <div id="divShowSprintDetails" runat="server">
            <asp:Label ID="lblMsg" runat="server" CssClass="label"></asp:Label>
            <table width="100">
                <tr>
                    <td>
                        <asp:Label ID="lblProject" runat="server" CssClass="label">Project</asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlProject" runat="server" CssClass="textfield" AutoPostBack="true"
                            OnSelectedIndexChanged="ddlProject_OnSelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblRelease" runat="server" CssClass="label">Release</asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlRelease" runat="server" CssClass="textfield" AutoPostBack="true">
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
            <asp:Button ID="btnGetSprints" runat="server" Text="GetSprints" OnClick="btn_GetSprints_click" />
        </div>
        <div id="div2" style="border: solid 1px silver; height: 520px; text-align: center;
            overflow-x: hidden; overflow-y: auto;">
            <asp:GridView ID="gvResults" AutoGenerateColumns="false" BorderColor="Black" runat="server"
                AllowSorting="true" OnRowCommand="gvResults_OnRowCommand">
                <HeaderStyle BackColor="White" Font-Size="10px" ForeColor="#990000" BorderStyle="None" />
                <RowStyle BackColor="#F7F3F7" Font-Names="Verdana" Font-Size="XX-Small" BorderStyle="None" />
                <AlternatingRowStyle BackColor="White" Font-Names="Verdana" Font-Size="XX-Small"
                    BorderStyle="None" />
                <Columns>
                    <asp:TemplateField HeaderStyle-Width="5%" ItemStyle-Width="5%" ItemStyle-BorderStyle="None"
                        HeaderStyle-BorderStyle="None">
                        <ItemTemplate>
                            <asp:CheckBox runat="server" ID="chkSprint" AutoPostBack="false" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField Visible="false">
                        <ItemTemplate>
                            <asp:Label ID="lblSprintId" runat="server" Text='<%# Bind("SprintId") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sprint Desc">
                        <ItemTemplate>
                            <asp:Label ID="lblUserStoryDescription" runat="server" Text='<%#Bind("SprintDescription") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Start Date">
                        <ItemTemplate>
                            <asp:Label ID="lblStartDate" runat="server" Text='<%#Bind("SprintStartDate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="End Date">
                        <ItemTemplate>
                            <asp:Label ID="lblEndDate" runat="server" Text='<%#Bind("SprintEndDate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Status">
                        <ItemTemplate>
                            <asp:Label ID="lblStatus" runat="server" Text='<%# getStatusDesc(Eval("Status")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-Width="5%" ItemStyle-Width="5%" ItemStyle-BorderStyle="None"
                        HeaderStyle-BorderStyle="None">
                        <ItemTemplate>
                            <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="EditSprint" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "SprintId") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <asp:Button ID="btnDelete" Text="Delete" runat="server" OnClientClick="return TestCheckBox()"
            OnClick="btnDeleteSprints_Click" />
        <asp:Button ID="btnAddActual" runat="server" CssClass="button" Text="AddSprint" OnClientClick="return showAddSprint()" />
    </div>
    </center>
    </form>
</body>
</html>
